package com.lt73.springplugin.autowired.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * @Author: hanxiao
 * @Date: 2022/3/18 17:57
 */
@Service
public class PersonService2 {

    @Autowired
    Map<String, IPerson> personMaps;

    public void work(String name) {
        IPerson person = personMaps.get(name);
        if (null != person) {
            person.doWork();
        }
    }
}